package xcmg.device.web.report;


import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import xcmg.device.infra.BasicController;
import xcmg.device.service.crm.util.ActionResultUtil;
import yb.ecp.fast.infra.annotation.FastMappingInfo;
import yb.ecp.fast.infra.infra.ActionResult;

@RestController
@RequestMapping("/report")
public class ReportController extends BasicController {
//
////    @Autowired
////    private ReportService reportService;
//
//    @Autowired
//    private CompanyInfoMapper companyInfoMapper;
//    @Autowired
//    private ThreeGuaranteesOutService threeGuaranteesOutService;
//
//    @Autowired
//    private AuthClient authClient;
//
//    @RequestMapping(value = "/materialStorage",method = RequestMethod.POST)
//    @ApiOperation("查询缺货报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult materialStorage(@RequestBody SearchCommonVO<MaterialsStorageVO> condit) throws Exception{
//        MaterialsStorageVO materialsStorageVO=condit.getFilters();
//        if(materialsStorageVO==null){
//            materialsStorageVO=new MaterialsStorageVO();
//        }
//        materialsStorageVO.setOrgId(getOrgId());
//        condit.setFilters(materialsStorageVO);
//        PageCommonVO pageCommonVO=reportService.materialStorage(condit);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/materialStorageExportAll",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    public void exportAll(MaterialsStorageVO condition)throws Exception {
//        condition.setOrgId(getOrgId());
//        reportService.materialStorageExportAll(condition);
//    }
//
//    @RequestMapping(value = "/materialStorageExport",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    public void materialStorageExport(String[] materialsNos)throws Exception {
//        reportService.materialStorageExport(Arrays.asList(materialsNos),getOrgId());
//    }
//
//    @RequestMapping(value = "/saleReportList",method = RequestMethod.POST)
//    @ApiOperation("销售统计报表")
//    @FastMappingInfo(needLogin = true)
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "saleNo", value = "销售单号",  paramType = "query"),
//            @ApiImplicitParam(name = "deliveryNo", value = "发货通知单号"),
//            @ApiImplicitParam(name = "createName", value = "制单人"),
//            @ApiImplicitParam(name = "createDateStart", value = "制单开始时间"),
//            @ApiImplicitParam(name = "createEndDate", value = "制单结束时间"),
//            @ApiImplicitParam(name = "materialsNo", value = "零件号"),
//            @ApiImplicitParam(name = "sapUpdate", value = "是否同步SAP"),
//            @ApiImplicitParam(name = "deliveryStatus", value = "物流状态"),
//            @ApiImplicitParam(name = "sapSaleOrder", value = "SAP销售订单"),
//            @ApiImplicitParam(name = "sapOutBill", value = "SAP外向发货单"),
//            @ApiImplicitParam(name = "receiveStartDate", value = "签收开始时间"),
//            @ApiImplicitParam(name = "receiveEndDate", value = "签收结束时间")
//    })
//
//    public ActionResult saleReportList(@RequestBody SearchCommonVO<SaleReportParam> condit) throws Exception{
//        SaleReportParam saleReportParam=condit.getFilters();
//        if(saleReportParam==null){
//            saleReportParam=new SaleReportParam();
//        }
//        saleReportParam.setSupplierOrgId(getOrgId());
//        condit.setFilters(saleReportParam);
//        PageCommonVO pageCommonVO=reportService.saleReportList(condit);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//
//    @RequestMapping(value = "/purchaseSaleReportList",method = RequestMethod.POST)
//    @ApiOperation("申请及销售报表")
//    @FastMappingInfo(needLogin = true)
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "saleNo", value = "销售单号",  paramType = "query"),
//            @ApiImplicitParam(name = "deliveryNo", value = "发货通知单号"),
//            @ApiImplicitParam(name = "createName", value = "制单人"),
//            @ApiImplicitParam(name = "createDateStart", value = "制单开始时间"),
//            @ApiImplicitParam(name = "createEndDate", value = "制单结束时间"),
//            @ApiImplicitParam(name = "materialsNo", value = "零件号"),
//            @ApiImplicitParam(name = "sapUpdate", value = "是否同步SAP"),
//            @ApiImplicitParam(name = "deliveryStatus", value = "物流状态"),
//            @ApiImplicitParam(name = "sapSaleOrder", value = "SAP销售订单"),
//            @ApiImplicitParam(name = "sapOutBill", value = "SAP外向发货单"),
//            @ApiImplicitParam(name = "receiveStartDate", value = "签收开始时间"),
//            @ApiImplicitParam(name = "receiveEndDate", value = "签收结束时间")
//    })
//
//    public ActionResult purchaseSaleReportList(@RequestBody SearchCommonVO<SaleReportParam> condit) throws Exception{
//        SaleReportParam saleReportParam=condit.getFilters();
//        if(saleReportParam==null){
//            saleReportParam=new SaleReportParam();
//        }
//        saleReportParam.setSupplierOrgId(getOrgId());
//        condit.setFilters(saleReportParam);
//        PageCommonVO pageCommonVO=reportService.purchaseSaleReportList(condit);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportSaleReport",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("销售统计报表导出")
//    public void exportSaleReport(SaleReportParam saleReportParam)throws Exception {
//        if(saleReportParam==null){
//            saleReportParam=new SaleReportParam();
//        }
//        saleReportParam.setSupplierOrgId(getOrgId());
//        reportService.exportSaleReport(saleReportParam);
//    }
//
//    @RequestMapping(value = "/exportPurchaseSaleReport",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("申请及销售报表导出")
//    public void exportPurchaseSaleReport(SaleReportParam saleReportParam)throws Exception {
//        if(saleReportParam==null){
//            saleReportParam=new SaleReportParam();
//        }
//        saleReportParam.setSupplierOrgId(getOrgId());
//        reportService.exportPurchaseSaleReport(saleReportParam);
//    }
//
//    @RequestMapping(value = "/threeOutReport",method = RequestMethod.POST)
//    @ApiOperation("三包统计报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult threeOutReport(@RequestBody SearchCommonVO<ThreeGuaranteesReportParam> condit)throws Exception{
//        ThreeGuaranteesReportParam threeGuaranteesReportParam=condit.getFilters();
//        if(threeGuaranteesReportParam==null){
//            threeGuaranteesReportParam=new ThreeGuaranteesReportParam();
//        }
//        threeGuaranteesReportParam.setOrgId(getOrgId());
//        condit.setFilters(threeGuaranteesReportParam);
//        PageCommonVO pageCommonVO=reportService.threeOutReport(condit);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportthreeOutReport",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("三包统计报表导出")
//    public void exportthreeOutReport(ThreeGuaranteesReportParam threeGuaranteesReportParam)throws Exception {
//        if(threeGuaranteesReportParam==null){
//            threeGuaranteesReportParam=new ThreeGuaranteesReportParam();
//        }
//        threeGuaranteesReportParam.setOrgId(getOrgId());
//        reportService.exportthreeOutReport(threeGuaranteesReportParam);
//    }
//
//    @RequestMapping(value = "/inventoryFlow",method = RequestMethod.POST)
//    @ApiOperation("库存流量报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult inventoryFlow(@RequestBody SearchCommonVO<InventoryFlowParam> condit) throws Exception{
//        InventoryFlowParam inventoryFlowParam=condit.getFilters();
//        if(inventoryFlowParam==null){
//            inventoryFlowParam=new InventoryFlowParam();
//        }
//        inventoryFlowParam.setOrgId(getOrgId());
//        condit.setFilters(inventoryFlowParam);
//        PageCommonVO pageCommonVO=reportService.inventoryFlow(condit);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportinventoryFlow",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("库存流量报表导出")
//    public void exportinventoryFlow(InventoryFlowParam inventoryFlowParam)throws Exception {
//        if(inventoryFlowParam==null){
//            inventoryFlowParam=new InventoryFlowParam();
//        }
//        inventoryFlowParam.setOrgId(getOrgId());
//        reportService.exportInventoryFlow(inventoryFlowParam);
//    }
//
@RequestMapping(value="/libraryAge/warn",method = {RequestMethod.POST,RequestMethod.GET})
    @ApiOperation("首页待办事项--库龄预警")
    @FastMappingInfo(needLogin = true)
    public ActionResult libraryAgeWarn() throws Exception {
//        LibraryAgeParam warnParam = new LibraryAgeParam();
//        String orgId = getOrgId();
//        String deptId = getDeptId();
//        warnParam.setOrgId(orgId);
//        warnParam.setQueryType(1);
//        warnParam.setMinValue(90);
//        Integer result = reportService.libraryAgeCount(warnParam, orgId, deptId);
        return ActionResultUtil.successActionResult(0);
    }
//
//
//    @RequestMapping(value = "/libraryAge",method = RequestMethod.POST)
//    @ApiOperation("库存库龄报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult libraryAge(@RequestBody SearchCommonVO<LibraryAgeParam> condit) throws Exception{
//        LibraryAgeParam libraryAgeParam=condit.getFilters();
//        if(libraryAgeParam==null){
//            libraryAgeParam=new LibraryAgeParam();
//        }
//        String orgId = getOrgId();
//        String deptId = getDeptId();
//        libraryAgeParam.setOrgId(orgId);
//        condit.setFilters(libraryAgeParam);
//        PageCommonVO pageCommonVO=reportService.libraryAge(condit,orgId,deptId);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/libraryAgeQuantity",method = RequestMethod.GET)
//    @ApiOperation("库存库龄数量")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult libraryAgeQuantity() throws Exception {
//        return actionResult(reportService.libraryAgeQuantity(getOrgId()));
//    }
//
//    @RequestMapping(value = "/exportLibraryAge",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("库存流量报表导出")
//    public void exportLibraryAge(LibraryAgeParam libraryAgeParam)throws Exception {
//        if(libraryAgeParam==null){
//            libraryAgeParam=new LibraryAgeParam();
//        }
//        String orgId = getOrgId();
//        String deptId = getDeptId();
//        libraryAgeParam.setOrgId(orgId);
//        reportService.exportLibraryAge(libraryAgeParam,orgId,deptId);
//    }
//
//    @RequestMapping(value = "/deliveryNoteWarnList",method = RequestMethod.POST)
//    @ApiOperation("未发货预警")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult deliveryNoteWarnList(@RequestBody SearchCommonVO<DeliveryNoteWarnParam> condit) throws Exception{
//        DeliveryNoteWarnParam deliveryNoteWarnParam=condit.getFilters();
//        if(deliveryNoteWarnParam==null){
//            deliveryNoteWarnParam=new DeliveryNoteWarnParam();
//        }
//        deliveryNoteWarnParam.setOrgId(getOrgId());
//        condit.setFilters(deliveryNoteWarnParam);
//        PageCommonVO pageCommonVO=reportService.deliveryNoteWarnList(condit);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportDeliveryNoteWarn",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("未发货预警导出")
//    public void exportDeliveryNoteWarn(DeliveryNoteWarnParam deliveryNoteWarnParam)throws Exception {
//        if(deliveryNoteWarnParam==null){
//            deliveryNoteWarnParam=new DeliveryNoteWarnParam();
//        }
//        deliveryNoteWarnParam.setOrgId(getOrgId());
//        reportService.exportDeliveryNoteWarn(deliveryNoteWarnParam);
//    }
//
//    @RequestMapping(value = "/instructionWarnList",method = RequestMethod.POST)
//    @ApiOperation("配送指令分析")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult instructionWarnList(@RequestBody SearchCommonVO<InstructionWarnParam> condit) throws Exception{
//        InstructionWarnParam instructionWarnParam=condit.getFilters();
//        if(instructionWarnParam==null){
//            instructionWarnParam=new InstructionWarnParam();
//        }
//        instructionWarnParam.setOrgId(getOrgId());
//        condit.setFilters(instructionWarnParam);
//        PageCommonVO pageCommonVO=reportService.instructionWarnList(condit);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportInstructionWarn",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("配送指令导出")
//    public void exportInstructionWarn(InstructionWarnParam instructionWarnParam)throws Exception {
//        if(instructionWarnParam==null){
//            instructionWarnParam=new InstructionWarnParam();
//        }
//        instructionWarnParam.setOrgId(getOrgId());
//        reportService.exportInstructionWarn(instructionWarnParam);
//    }
//
//    @RequestMapping(value = "/dealerPlanList",method = RequestMethod.POST)
//    @ApiOperation("经销商销售计划预排报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult dealerPlanList(@RequestBody SearchCommonVO<DealerPlanVO> condition) throws Exception{
//        DealerPlanVO dealerPlanVO = condition.getFilters();
//        if(dealerPlanVO == null){
//            dealerPlanVO = new DealerPlanVO();
//        }
//        dealerPlanVO.setOrgId(getOrgId());
//        condition.setFilters(dealerPlanVO);
//        PageCommonVO pageCommonVO = reportService.dealerPlanList(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportDealerPlan",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("经销商销售计划预排报表导出")
//    public void exportDealerPlan(DealerPlanVO condition)throws Exception {
//        if(condition == null){
//            condition = new DealerPlanVO();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportDealerPlan(condition);
//    }
//
//    @RequestMapping(value = "/inventoryWarningList",method = RequestMethod.POST)
//    @ApiOperation("安全库存预警报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult inventoryWarningList(@RequestBody SearchCommonVO<InventoryWarning> condition) throws Exception{
//        InventoryWarning dealerPlanVO = condition.getFilters();
//        if(dealerPlanVO == null){
//            dealerPlanVO = new InventoryWarning();
//        }
//        dealerPlanVO.setOrgId(getOrgId());
//        condition.setFilters(dealerPlanVO);
//        PageCommonVO pageCommonVO = reportService.inventoryWarningList(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportinventoryWarning",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("安全库存预警报表导出")
//    public void exportinventoryWarning(InventoryWarning condition)throws Exception {
//        if(condition == null){
//            condition = new InventoryWarning();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportinventoryWarning(condition);
//    }
//
//    @RequestMapping(value = "/dealerArapList",method = RequestMethod.POST)
//    @ApiOperation("客户应收账款报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult dealerArapList(@RequestBody SearchCommonVO<DealerArapVO> condition) throws Exception{
//        DealerArapVO dealerPlanVO = condition.getFilters();
//        if(dealerPlanVO == null){
//            dealerPlanVO = new DealerArapVO();
//        }
//        dealerPlanVO.setOrgId(getOrgId());
//        condition.setFilters(dealerPlanVO);
//        PageCommonVO pageCommonVO = reportService.dealerArapList(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportdealerArap",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("客户应收账款报表导出")
//    public void exportdealerArap(DealerArapVO condition)throws Exception {
//        if(condition == null){
//            condition = new DealerArapVO();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportDealerArapList(condition);
//    }
//
//    @RequestMapping(value = "/inventoryOverstock",method = RequestMethod.POST)
//    @ApiOperation("库龄分析")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult inventoryOverstock(@RequestBody SearchCommonVO<InventoryOverstockParam> condition) throws Exception{
//        InventoryOverstockParam inventoryOverstockParam = condition.getFilters();
//        if(inventoryOverstockParam == null){
//            inventoryOverstockParam = new InventoryOverstockParam();
//        }
//        inventoryOverstockParam.setOrgId(getOrgId());
//        condition.setFilters(inventoryOverstockParam);
//        PageCommonVO pageCommonVO = reportService.inventoryOverstock(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportInventoryOverstock",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("库龄分析导出")
//    public void exportInventoryOverstock(InventoryOverstockParam condition)throws Exception {
//        if(condition == null){
//            condition = new InventoryOverstockParam();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportInventoryOverstock(condition);
//    }
//
//    @RequestMapping(value = "/unsoldList",method = RequestMethod.POST)
//    @ApiOperation("滞销备件报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult unsoldList(@RequestBody SearchCommonVO<UnsoldVO> condition) throws Exception{
//        UnsoldVO unsoldVO = condition.getFilters();
//        if(unsoldVO == null){
//            unsoldVO = new UnsoldVO();
//        }
//        unsoldVO.setOrgId(getOrgId());
//        condition.setFilters(unsoldVO);
//        PageCommonVO pageCommonVO = reportService.unsoldList(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportUnsold",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("滞销备件报表导出")
//    public void exportUnsold(UnsoldVO condition)throws Exception {
//        if(condition == null){
//            condition = new UnsoldVO();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportunsoldList(condition);
//    }
//
//    @RequestMapping(value = "/dealerInOutList",method = RequestMethod.POST)
//    @ApiOperation("进销存报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult dealerInOutList(@RequestBody SearchCommonVO<DealerInOutVO> condition) throws Exception{
//        DealerInOutVO dealerInOutVO = condition.getFilters();
//        if(dealerInOutVO == null){
//            dealerInOutVO = new DealerInOutVO();
//        }
//        dealerInOutVO.setOrgId(getOrgId());
//        condition.setFilters(dealerInOutVO);
//        PageCommonVO pageCommonVO = reportService.dealerInOutList(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportDealerInOutList",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("进销存报表导出")
//    public void exportDealerInOutList(DealerInOutVO condition)throws Exception {
//        if(condition == null){
//            condition = new DealerInOutVO();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportDealerInOutList(condition);
//    }
//
//    @RequestMapping(value = "/saleCompareList",method = RequestMethod.POST)
//    @ApiOperation("销售对比报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult saleCompareList(@RequestBody SearchCommonVO<SaleCompareVO> condition) throws Exception{
//        SaleCompareVO dealerInOutVO = condition.getFilters();
//        if(dealerInOutVO == null){
//            dealerInOutVO = new SaleCompareVO();
//        }
//        dealerInOutVO.setOrgId(getOrgId());
//        condition.setFilters(dealerInOutVO);
//        PageCommonVO pageCommonVO = reportService.saleCompareList(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportSaleCompareList",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("销售对比报表导出")
//    public void exportSaleCompareList(SaleCompareVO condition)throws Exception {
//        if(condition == null){
//            condition = new SaleCompareVO();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportSaleCompareList(condition);
//    }
//
//    @RequestMapping(value = "/indicatorReport",method = RequestMethod.POST)
//    @ApiOperation("备件经营指标统计表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult indicatorReport(@RequestBody IndicatorVO condition) throws Exception{
//        // 兼容集团层面的报表
//        if (null != condition && StringUtils.isNotBlank(condition.getOrgId())) {
//            condition.setOrgId(condition.getOrgId());
//        } else {
//            condition.setOrgId(getOrgId());
//        }
//        return actionResult(reportService.indicatorReport(condition));
//    }
//
//    @RequestMapping(value = "/purchaseReportList",method = RequestMethod.POST)
//    @ApiOperation("代理商采购报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult purchaseReportList(@RequestBody SearchCommonVO<PurchaseReportVO> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.purchaseReportList(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportPurchaseReportList",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("代理商采购报表导出")
//    public void exportPurchaseReportList(PurchaseReportVO condition) throws Exception {
//        reportService.exportPurchaseReportList(condition, getOrgId());
//    }
//
//    @RequestMapping(value = "/planningAccuracy",method = RequestMethod.POST)
//    @ApiOperation("计划准确率")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult planningAccuracy(@RequestBody SearchCommonVO<PlanningAccuracyParam> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.planningAccuracy(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportPlanningAccuracy",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("计划准确率报表导出")
//    public void exportPlanningAccuracy(PlanningAccuracyParam condition) throws Exception {
//        reportService.exportplanningAccuracy(condition,getOrgId());
//    }
//
//    @RequestMapping(value = "/salesOutboundReportList",method = RequestMethod.POST)
//    @ApiOperation("代理销售出库报表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult salesOutboundReportList(@RequestBody SearchCommonVO<SalesOutboundReportVO> condition) throws Exception{
//        if (null == condition.getFilters()){
//            SalesOutboundReportVO reportVO = new SalesOutboundReportVO();
//            condition.setFilters(reportVO);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        PageCommonVO pageCommonVO = reportService.salesOutboundReportList(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportSalesOutbound",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("销售出库报表导出")
//    public void exportSalesOutboundReportList(SalesOutboundReportVO condition)throws Exception {
//        if(condition == null){
//            condition = new SalesOutboundReportVO();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportSalesOutboundReportList(condition);
//    }
//
//    @RequestMapping(value = "/querySparePartsAgent",method = RequestMethod.POST)
//    @ApiOperation("备件订单满足率-代理商")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult querySparePartsAgent(@RequestBody SearchCommonVO<SparePartsOrderAccuracyParam> condition) throws Exception{
//        if (null == condition.getFilters()){
//            SparePartsOrderAccuracyParam reportVO = new SparePartsOrderAccuracyParam();
//            condition.setFilters(reportVO);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        PageCommonVO pageCommonVO = reportService.querySparePartsAgent(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/querySparePartsDispatcher",method = RequestMethod.POST)
//    @ApiOperation("备件订单满足率-调度员")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult querySparePartsDispatcher(@RequestBody SearchCommonVO<SparePartsOrderAccuracyParam> condition) throws Exception{
//        if (null == condition.getFilters()){
//            SparePartsOrderAccuracyParam reportVO = new SparePartsOrderAccuracyParam();
//            condition.setFilters(reportVO);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        PageCommonVO pageCommonVO = reportService.querySparePartsDispatcher(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/querySparePartsPurchasGroup",method = RequestMethod.POST)
//    @ApiOperation("备件订单满足率-采购组")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult querySparePartsPurchasGroup(@RequestBody SearchCommonVO<SparePartsOrderAccuracyParam> condition) throws Exception{
//        if (null == condition.getFilters()){
//            SparePartsOrderAccuracyParam reportVO = new SparePartsOrderAccuracyParam();
//            condition.setFilters(reportVO);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        PageCommonVO pageCommonVO = reportService.querySparePartsPurchasGroup(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportSparePartsAgent",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出备件订单满足率-代理商")
//    public void exportSparePartsAgent(SparePartsOrderAccuracyParam condition)throws Exception {
//        if(condition == null){
//            condition = new SparePartsOrderAccuracyParam();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportSparePartsAgent(condition);
//    }
//
//    @RequestMapping(value = "/exportSparePartsDispatcher",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出备件订单满足率-调度员")
//    public void exportSparePartsDispatcher(SparePartsOrderAccuracyParam condition)throws Exception {
//        if(condition == null){
//            condition = new SparePartsOrderAccuracyParam();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportSparePartsDispatcher(condition);
//    }
//
//    @RequestMapping(value = "/exportSparePartsPurchasGroup",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出备件订单满足率-采购组")
//    public void exportSparePartsPurchasGroup(SparePartsOrderAccuracyParam condition)throws Exception {
//        if(condition == null){
//            condition = new SparePartsOrderAccuracyParam();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportSparePartsPurchasGroup(condition);
//    }
//
//    @PostMapping(value = "/agentCommodityAmount")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("代理商品类金额列表")
//    public ActionResult agentCommodityAmount(@RequestBody SearchCommonVO<AgentCommodityAmountParam> condition)throws Exception {
//        if (null == condition.getFilters()){
//            AgentCommodityAmountParam reportVO = new AgentCommodityAmountParam();
//            condition.setFilters(reportVO);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        return actionResult(reportService.agentCommodityAmount(condition).getPageInfo());
//    }
//
//
//    @RequestMapping(value = "/exportAgentCommodityAmount",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出代理商品类金额")
//    public void exportAgentCommodityAmount(AgentCommodityAmountParam condition)throws Exception {
//        if(condition == null){
//            condition = new AgentCommodityAmountParam();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportAgentCommodityAmount(condition);
//    }
//
//    @PostMapping(value = "/agentInventoryAmountList")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("获取代理商库存列表")
//    public ActionResult agentInventoryAmountList(@RequestBody SearchCommonVO<AgentCommodityAmountParam> condition)throws Exception {
//        if (null == condition.getFilters()){
//            AgentCommodityAmountParam reportVO = new AgentCommodityAmountParam();
//            condition.setFilters(reportVO);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        return actionResult(reportService.agentInventoryAmountList(condition).getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportAgentInventoryAmount",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出代理商库存列表")
//    public void exportAgentInventoryAmount(AgentCommodityAmountParam condition)throws Exception {
//        if(condition == null){
//            condition = new AgentCommodityAmountParam();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportAgentInventoryAmount(condition);
//    }
//
//    @PostMapping(value = "/agentTerminalSalesByMaterial")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("代理商终端销售情况按零件")
//    public ActionResult agentTerminalSalesByMaterial(@RequestBody SearchCommonVO<AgentCommodityAmountParam> condition)throws Exception {
//        if (null == condition.getFilters()){
//            AgentCommodityAmountParam reportVO = new AgentCommodityAmountParam();
//            condition.setFilters(reportVO);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        return actionResult(reportService.agentTerminalSalesByMaterial(condition).getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportAgentTerminalSalesByMaterial",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出代理商终端销售情况按零件")
//    public void exportAgentTerminalSalesByMaterial(AgentCommodityAmountParam condition)throws Exception {
//        if(condition == null){
//            condition = new AgentCommodityAmountParam();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportAgentTerminalSalesByMaterial(condition);
//    }
//
//    @PostMapping(value = "/agentTerminalSalesByOutbound")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("代理商终端销售情况按出库类型")
//    public ActionResult agentTerminalSalesByOutbound(@RequestBody SearchCommonVO<AgentTerminalSalesOutboundParam> condition)throws Exception {
//        if (null == condition.getFilters()){
//            AgentTerminalSalesOutboundParam reportVO = new AgentTerminalSalesOutboundParam();
//            condition.setFilters(reportVO);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        return actionResult(reportService.agentTerminalSalesByOutbound(condition).getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportAgentTerminalSalesByOutbound",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出代理商终端销售情况按出库类型")
//    public void exportAgentTerminalSalesByOutbound(AgentTerminalSalesOutboundParam condition)throws Exception {
//        if(condition == null){
//            condition = new AgentTerminalSalesOutboundParam();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportAgentTerminalSalesByOutbound(condition);
//    }
//
//    @PostMapping(value = "/agentAgentTurnoverRateList")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("获取代理商周转率列表")
//    public ActionResult agentAgentTurnoverRateList(@RequestBody SearchCommonVO<AgentTurnoverRateParam> condition)throws Exception {
//        if (null == condition.getFilters()){
//            AgentTurnoverRateParam reportVO = new AgentTurnoverRateParam();
//            condition.setFilters(reportVO);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        return actionResult(reportService.agentAgentTurnoverRateList(condition).getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportAgentAgentTurnoverRate",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出代理商周转率列表")
//    public void exportAgentAgentTurnoverRate(AgentTurnoverRateParam condition)throws Exception {
//        if(condition == null){
//            condition = new AgentTurnoverRateParam();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportAgentAgentTurnoverRate(condition);
//    }
//
//    @RequestMapping(value = "/timePeriodPurchaseSituation",method = RequestMethod.POST)
//    @ApiOperation("各时间段采购情况")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult timePeriodPurchaseSituation(@RequestBody SearchCommonVO<TimePeriodPurchaseSituationParam> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.timePeriodPurchaseSituation(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportTimePeriodPurchaseSituation",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("各时间段采购情况导出")
//    public void exportTimePeriodPurchaseSituation(TimePeriodPurchaseSituationParam condition) throws Exception {
//        reportService.exportTimePeriodPurchaseSituation(condition,getOrgId());
//    }
//
//    @RequestMapping(value = "/purchaseAmountAnalysis",method = RequestMethod.POST)
//    @ApiOperation("采购订单金额分析列表")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult purchaseAmountAnalysis(@RequestBody SearchCommonVO<PurchaseAmountAnalysisVO> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.purchaseAmountAnalysis(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportPurchaseAmountAnalysis",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出采购订单金额分析数据")
//    public void exportPurchaseAmountAnalysis(PurchaseAmountAnalysisVO condition) throws Exception {
//        reportService.exportPurchaseAmountAnalysis(condition,getOrgId());
//    }
//
//
//    @RequestMapping(value = "/missingDispatcher",method = RequestMethod.POST)
//    @ApiOperation("实时缺项分析报表-调度员")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult missingDispatcher(@RequestBody SearchCommonVO<MissingVO> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.missingDispatcher(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportMissingDispatcher",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出实时缺项分析报表-调度员")
//    public void exportMissingDispatcher(MissingVO condition) throws Exception {
//        reportService.exportMissingDispatcher(condition,getOrgId());
//    }
//
//
//    @RequestMapping(value = "/missingAgent",method = RequestMethod.POST)
//    @ApiOperation("实时缺项分析报表-代理商")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult missingAgent(@RequestBody SearchCommonVO<MissingVO> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.missingAgent(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportMissingAgent",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出实时缺项分析报表-代理商")
//    public void exportMissingAgent(MissingVO condition) throws Exception {
//        reportService.exportMissingAgent(condition,getOrgId());
//    }
//
//
//    @RequestMapping(value = "/missingOrderType",method = RequestMethod.POST)
//    @ApiOperation("实时缺项分析报表-订单类型")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult missingOrderType(@RequestBody SearchCommonVO<MissingVO> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.missingOrderType(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportMissingOrderType",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出实时缺项分析报表-订单类型")
//    public void exportMissingOrderType(MissingVO condition) throws Exception {
//        reportService.exportMissingOrderType(condition,getOrgId());
//    }
//
//    @RequestMapping(value = "/missingMaterialOwnership",method = RequestMethod.POST)
//    @ApiOperation("实时缺项分析报表-零件归属")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult missingMaterialOwnership(@RequestBody SearchCommonVO<MissingVO> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.missingMaterialOwnership(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportMissingMaterialOwnership",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出实时缺项分析报表-零件归属")
//    public void exportMissingMaterialOwnership(MissingVO condition) throws Exception {
//        reportService.exportMissingMaterialOwnership(condition,getOrgId());
//    }
//
//    @RequestMapping(value = "/orderSatisfyRate",method = RequestMethod.POST)
//    @ApiOperation("查询订单满足率")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult orderSatisfyRate(@RequestBody SearchCommonVO<OrderSatisfyRateParam> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.orderSatisfyRate(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportOrderSatisfyRate",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出订单满足率")
//    public void exportOrderSatisfyRate(OrderSatisfyRateParam condition) throws Exception {
//        reportService.exportOrderSatisfyRate(condition,getOrgId());
//    }
//
//    @RequestMapping(value = "/orderSatisfyRatePurchaseGroup",method = RequestMethod.POST)
//    @ApiOperation("查询订单满足率--采购组")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult orderSatisfyRatePurchaseGroup(@RequestBody SearchCommonVO<OrderSatisfyRateParam> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.orderSatisfyRatePurchaseGroup(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportOrderSatisfyRatePurchaseGroup",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出订单满足率--采购组")
//    public void exportOrderSatisfyRatePurchaseGroup(OrderSatisfyRateParam condition) throws Exception {
//        reportService.exportOrderSatisfyRatePurchaseGroup(condition,getOrgId());
//    }
//
//    @RequestMapping(value = "/orderSatisfyRateMaterialsType",method = RequestMethod.POST)
//    @ApiOperation("查询订单满足率--零件类型")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult orderSatisfyRateMaterialsType(@RequestBody SearchCommonVO<OrderSatisfyRateParam> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.orderSatisfyRateMaterialsType(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportOrderSatisfyRateMaterialsType",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出订单满足率--零件类型")
//    public void exportOrderSatisfyRateMaterialsType(OrderSatisfyRateParam condition) throws Exception {
//        reportService.exportOrderSatisfyRateMaterialsType(condition,getOrgId());
//    }
//
//    @RequestMapping(value = "/orderSatisfyRateSupplierName",method = RequestMethod.POST)
//    @ApiOperation("查询订单满足率--供应商")
//    @FastMappingInfo(needLogin = true)
//    public ActionResult orderSatisfyRateSupplierName(@RequestBody SearchCommonVO<OrderSatisfyRateParam> condition) throws Exception{
//        PageCommonVO pageCommonVO = reportService.orderSatisfyRateSupplierName(condition, getOrgId());
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportOrderSatisfyRateSupplierName",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出订单满足率--供应商")
//    public void exportOrderSatisfyRateSupplierName(OrderSatisfyRateParam condition) throws Exception {
//        reportService.exportOrderSatisfyRateSupplierName(condition,getOrgId());
//    }
//
//    @PostMapping(value = "/agentFinanceCompany")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("获取代理商财务报表-公司层")
//    public ActionResult agentFinanceCompany(@RequestBody SearchCommonVO<AgentFinanceCompanyParam> condition)throws Exception {
//        if (null == condition.getFilters()){
//            AgentFinanceCompanyParam finance = new AgentFinanceCompanyParam();
//            condition.setFilters(finance);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        return actionResult(reportService.agentFinanceCompany(condition));
//    }
//
//    @PostMapping(value = "/agentFinanceCompanyList")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("获取全部代理商财务报表-公司层")
//    public ActionResult agentFinanceCompanyList(@RequestBody SearchCommonVO<AgentFinanceCompanyParam> condition)throws Exception {
//        if (null == condition.getFilters()){
//            AgentFinanceCompanyParam finance = new AgentFinanceCompanyParam();
//            condition.setFilters(finance);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        return actionResult(reportService.agentFinanceCompanyList(condition).getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportAgentFinanceCompany",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出代理商财务报表-公司层")
//    public void exportAgentFinanceCompany(AgentTurnoverRateParam condition)throws Exception {
//        if(condition == null){
//            condition = new AgentTurnoverRateParam();
//        }
//        condition.setOrgId(getOrgId());
//        reportService.exportAgentAgentTurnoverRate(condition);
//    }
//
//    @PostMapping(value = "/agentFinanceWarehouse")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("获取代理商仓库财务报表-仓库层")
//    public ActionResult agentFinanceWarehouse(@RequestBody SearchCommonVO<AgentFinanceCompanyParam> condition)throws Exception {
//        if (null == condition.getFilters()){
//            AgentFinanceCompanyParam finance = new AgentFinanceCompanyParam();
//            condition.setFilters(finance);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        return actionResult(reportService.agentFinanceWarehouse(condition).getPageInfo());
//    }
//
//    @PostMapping(value = "/agentFinanceWarehouseList")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("获取全部代理商财务报表-仓库层")
//    public ActionResult agentFinanceWarehouseList(@RequestBody SearchCommonVO<AgentFinanceCompanyParam> condition)throws Exception {
//        if (null == condition.getFilters()){
//            AgentFinanceCompanyParam finance = new AgentFinanceCompanyParam();
//            condition.setFilters(finance);
//        }
//        condition.getFilters().setOrgId(getOrgId());
//        return actionResult(reportService.agentFinanceWarehouseList(condition).getPageInfo());
//    }
//
//
//    @PostMapping(value = "/agentSalesOutDetailList")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("终端销售明细报表")
//    public ActionResult agentSalesOutDetailList(@RequestBody SearchCommonVO<AgentSalesOutDetailVO> condition) {
//        PageCommonVO result;
//        CompanyInfoDO companyInfoDO;
//        try {
//            companyInfoDO = companyInfoMapper.item(getOrgId());
//            condition.getFilters().setOrgId(getOrgId());
//            result = reportService.agentSalesOutDetailList(condition, companyInfoDO);
//        } catch (Exception e) {
//            return actionResult(ErrorCode.Failure, e.getMessage());
//        }
//        return new ActionResult4Report(ErrorCode.Success.getCode(), ErrorCode.Success.getDesc(), result.getPageInfo(), companyInfoDO.getIsSap());
//    }
//
//    @RequestMapping(value = "/exportAgentSalesOutDetail",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("终端销售明细报表导出")
//    public void agentSalesOutDetailExport(AgentSalesOutDetailVO filter) throws Exception {
//        CompanyInfoDO companyInfoDO = companyInfoMapper.item(getOrgId());
//        filter.setOrgId(getOrgId());
//        reportService.exportAgentSalesOutDetail(filter, companyInfoDO);
//    }
//
//    class ActionResult4Report extends ActionResult{
//
//        private int coreCompanyFlag;
//
//        public ActionResult4Report(int code, String message, Object value, int coreCompanyFlag) {
//            super(code, message, value);
//            this.coreCompanyFlag = coreCompanyFlag;
//        }
//
//        public int getCoreCompanyFlag() {
//            return coreCompanyFlag;
//        }
//
//        public void setCoreCompanyFlag(int coreCompanyFlag) {
//            this.coreCompanyFlag = coreCompanyFlag;
//        }
//    }
//
//    /**
//     * @Des 旧件报表查询
//     * @Date 2020/10/15 11:06
//     * @Author wangzhaoyu
//     * @Param []
//     * @Return yb.ecp.fast.infra.infra.ActionResult
//     */
//    @PostMapping("wornOutReport")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("旧件报表查询")
//    public ActionResult wornOutReport(@RequestBody SearchCommonVO<WornOutReportQueryParam> condition) throws Exception {
//        String orgId = getOrgId();
//        String userId = getUserId();
//        PageCommonVO<WornOutReportQueryResult> wornOutReport = reportService.getWornOutReport(condition,orgId,userId);
//        PageInfo pageInfo = wornOutReport.getPageInfo();
//        return ActionResultUtil.successActionResult(pageInfo);
//    }
//
//    @ApiOperation("旧件报表导出")
//    @PostMapping("wornOutReport/export")
//    public void wornOutReportExport(WornOutReportQueryParam param) throws Exception {
//        String orgId = getOrgId();
//        String userId = getUserId();
//        reportService.wornOutReportExport(param,orgId,userId);
//    }
//
//
//    /**
//     * @Des 旧件返厂状态修改接口
//     * @Date 2020/11/17 15:51
//     * @Author wangzhaoyu
//     * @Param [param]
//     * @Return yb.ecp.fast.infra.infra.ActionResult
//     */
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("旧件报表更新发货信息")
//    @RequestMapping(value = "updateWornOutReturnStatus" , method = RequestMethod.POST)
//    public ActionResult updateWornOutReturnStatus(@RequestBody WornOutReportReturnStatusChangeParam param){
//        String guaranteesOutNo = param.getGuaranteesOutNo();
//        String materialsNo = param.getMaterialsNo();
//        Integer returnStatus = param.getReturnStatus();
//        if(StringUtils.isEmpty(guaranteesOutNo) || StringUtils.isEmpty(materialsNo)){
//            return ActionResultUtil.errorActionResult(ErrorCode.IllegalArument);
//        }
//        if(returnStatus == null ||
//                (returnStatus.compareTo(WornoutReturnStatusEnum.DELIVERYED.getStatus()) != 0
//                        && returnStatus.compareTo(WornoutReturnStatusEnum.RECEIVED.getStatus()) != 0
//                        && returnStatus.compareTo(WornoutReturnStatusEnum.INIT.getStatus()) != 0)){
//            return ActionResultUtil.errorActionResult(ErrorCode.IllegalArument);
//        }
//        threeGuaranteesOutService.updateWornOutReturn(guaranteesOutNo,materialsNo,returnStatus);
//        return ActionResultUtil.successActionResult();
//    }
//
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("旧件报表编辑备注")
//    @RequestMapping(value = "wornOutRemark" , method = RequestMethod.POST)
//    public ActionResult wornOutRemark(@RequestBody RemarkWornoutParam param){
//        String guaranteesOutNo = param.getGuaranteesOutNo();
//        String materialsNo = param.getMaterialsNo();
//        if(StringUtils.isEmpty(guaranteesOutNo) || StringUtils.isEmpty(materialsNo)){
//            return ActionResultUtil.errorActionResult(ErrorCode.IllegalArument);
//        }
//        String wornreturnRemark = param.getWornreturnRemark();
//        threeGuaranteesOutService.updateWornOutReturnRemark(guaranteesOutNo,materialsNo,wornreturnRemark);
//        return ActionResultUtil.successActionResult();
//
//    }
//
//    /**
//     * @Des 前移库存报表
//     * @Date 2021/2/24 16:33
//     * @Author wangzhaoyu
//     * @Param [param]
//     * @Return yb.ecp.fast.infra.infra.ActionResult
//     */
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("前移库存报表查询")
//    @RequestMapping(value = "forwardInventory" , method = RequestMethod.POST)
//    public ActionResult forwardInventory(@RequestBody SearchCommonVO<ForwardInventoryQueryParamVO> condition) throws Exception {
//        String orgId = getOrgId();
//        PageCommonVO<ForwardInventoryReportVO> result = reportService.forwardInventoryReport(condition,orgId);
//        return ActionResultUtil.successActionResult(result.getPageInfo());
//    }
//
//    /**
//     * @Des 前移库存报表导出全部
//     * @Date 2021/2/24 17:58
//     * @Author wangzhaoyu
//     * @Param [param]
//     * @Return void
//     */
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("前移库存报表导出")
//    @RequestMapping(value = "exportForwardInventoryAll" , method = RequestMethod.POST)
//    public void exportForwardInventoryAll(ForwardInventoryQueryParamVO param) throws Exception {
//        String orgId = getOrgId();
//        reportService.exportForwardInventoryReportAll(param,orgId);
//    }
//
//    /**
//     * @Des 前移库存报表部分导出
//     * @Date 2021/2/24 18:31
//     * @Author wangzhaoyu
//     * @Param [param]
//     * @Return void
//     */
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("前移库存报表部分导出")
//    @RequestMapping(value = "exportForwardInventorySelected" , method = RequestMethod.POST)
//    public void exportForwardInventorySelected(ForwardInventoryQueryParamVO param) throws Exception {
//        String orgId = getOrgId();
//        List<String> barCodes = param.getBarCodes();
//        if(CollectionUtils.isEmpty(barCodes)){
//            return ;
//        }
//        reportService.exportForwardInventorySelected(barCodes,orgId);
//    }
//
//    @PostMapping(value = "/agentSalesOutDetailList4Cy")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("终端销售明细报表-进出口")
//    public ActionResult agentSalesOutDetailList4Cy(@RequestBody SearchCommonVO<AgentSalesOutDetailVO> condition) {
//        PageCommonVO result;
//        CompanyInfoDO companyInfoDO;
//        try {
//            //getOrgId()
//            String orgId = getOrgId();
//            companyInfoDO = companyInfoMapper.item(orgId);
//            condition.getFilters().setOrgId(orgId);
//            result = reportService.agentSalesOutDetailList4Cy(condition, companyInfoDO);
//        } catch (Exception e) {
//            return actionResult(ErrorCode.Failure, e.getMessage());
//        }
//        return new ActionResult4Report(ErrorCode.Success.getCode(), ErrorCode.Success.getDesc(), result.getPageInfo(), companyInfoDO.getIsSap());
//    }
//
//    @RequestMapping(value = "/exportAgentSalesOutDetail4Cy",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("终端销售明细报表导出-进出口")
//    public void agentSalesOutDetailExport4Cy(AgentSalesOutDetailVO filter) throws Exception {
//        String orgId = getOrgId();
//        CompanyInfoDO companyInfoDO = companyInfoMapper.item(orgId);
//        filter.setOrgId(orgId);
//        reportService.exportAgentSalesOutDetail4Cy(filter, companyInfoDO);
//    }
//
//    @PostMapping(value = "/agentTerminalSalesByOutbound4Cy")
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("代理商终端销售情况按出库类型-进出口")
//    public ActionResult agentTerminalSalesByOutbound4Cy(@RequestBody SearchCommonVO<AgentTerminalSalesOutboundParam> condition)throws Exception {
//        if (null == condition.getFilters()){
//            AgentTerminalSalesOutboundParam reportVO = new AgentTerminalSalesOutboundParam();
//            condition.setFilters(reportVO);
//        }
//        //getOrgId()
//        String orgId = getOrgId();
//        condition.getFilters().setOrgId(orgId);
//        return actionResult(reportService.agentTerminalSalesByOutbound4Cy(condition).getPageInfo());
//    }
//
//    @RequestMapping(value = "/exportAgentTerminalSalesByOutbound4Cy",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("导出代理商终端销售情况按出库类型-进出口")
//    public void exportAgentTerminalSalesByOutbound4Cy(AgentTerminalSalesOutboundParam condition)throws Exception {
//        if(condition == null){
//            condition = new AgentTerminalSalesOutboundParam();
//        }
//        //getOrgId()
//        String orgId = getOrgId();
//        condition.setOrgId(orgId);
//        reportService.exportAgentTerminalSalesByOutbound4Cy(condition);
//    }
//
//    /**
//     * 客户订单提报统计
//     * add by syf
//     * 2023年3月2日15点34分
//     * @param condition
//     * @throws Exception
//     */
//    @RequestMapping(value = "/customerOrderStatements",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("客户订单提报统计")
//    public ActionResult customerOrderStatement(@RequestBody SearchCommonVO<CustomerOrderStatementQueryVO> condition) throws Exception {
//        CustomerOrderStatementQueryVO queryVO = condition.getFilters();
//        queryVO.setOrgId(getOrgId());
//
//        PageCommonVO pageCommonVO = reportService.getCustomerOrderStatementList(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    /**
//     * 发货跟踪报表，缺货统计报表；
//     * 缺货统计报表是在发货统计报表的基础上只显示发货数不等于订货数的数据
//     * add by syf
//     * 2023年3月4日16点44分
//     * @param condition
//     * @throws Exception
//     */
//    @RequestMapping(value = "/deliveryTrackingReports",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("发货跟踪报表")
//    public ActionResult deliveryTrackingReports(@RequestBody SearchCommonVO<DeliveryTrackingReportQueryVO> condition) throws Exception {
//        DeliveryTrackingReportQueryVO queryVO = condition.getFilters();
//        queryVO.setOrgId(getOrgId());
//
//        PageCommonVO pageCommonVO = reportService.getdeliveryTrackingReportList(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    /**
//     * 订货满足率-总体满足率
//     * add by syf
//     * 2023年3月15日16点44分
//     * @param condition
//     * @throws Exception
//     */
//    @RequestMapping(value = "/orderGoods/contentPercentTotalReports",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("订货满足率-总体满足率")
//    public ActionResult cassFillRateReports(@RequestBody SearchCommonVO<DeliveryTrackingReportQueryVO> condition) throws Exception {
//        DeliveryTrackingReportQueryVO queryVO = condition.getFilters();
//        queryVO.setOrgId(getOrgId());
//
//        PageCommonVO pageCommonVO = reportService.contentPercentTotalReports(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    /**
//     * 订货满足率-按代理商统计满足率
//     * add by syf
//     * 2023年3月15日16点44分
//     * @param condition
//     * @throws Exception
//     */
//    @RequestMapping(value = "/orderGoods/contentPercentAgentReports",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("订货满足率-按代理商统计满足率")
//    public ActionResult contentPercentAgentReports(@RequestBody SearchCommonVO<DeliveryTrackingReportQueryVO> condition) throws Exception {
//        DeliveryTrackingReportQueryVO queryVO = condition.getFilters();
//        queryVO.setOrgId(getOrgId());
//
//        PageCommonVO pageCommonVO = reportService.contentPercentAgentReports(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    /**
//     * 订货满足率-按零件统计满足率
//     * add by syf
//     * 2023年3月15日16点44分
//     * @param condition
//     * @throws Exception
//     */
//    @RequestMapping(value = "/orderGoods/contentPercentMaterialReports",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("订货满足率-按零件统计满足率")
//    public ActionResult contentPercentMaterialReports(@RequestBody SearchCommonVO<DeliveryTrackingReportQueryVO> condition) throws Exception {
//        DeliveryTrackingReportQueryVO queryVO = condition.getFilters();
//        queryVO.setOrgId(getOrgId());
//
//        PageCommonVO pageCommonVO = reportService.contentPercentMaterialReports(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    /**
//     * 直投采购分析
//     * add by syf
//     * 2023年3月16日16点44分
//     * @param condition
//     * @throws Exception
//     */
//    @RequestMapping(value = "/directPurchaseAnalyseReports",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("直投采购分析")
//    public ActionResult directPurchaseAnalyseReports(@RequestBody SearchCommonVO<DeliveryTrackingReportQueryVO> condition) throws Exception {
//        DeliveryTrackingReportQueryVO queryVO = condition.getFilters();
//        queryVO.setOrgId(getOrgId());
//
//        PageCommonVO pageCommonVO = reportService.directPurchaseAnalyseReports(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    /**
//     * 总体销售情况报表
//     * add by syf
//     * 2023年3月17日16点44分
//     * @param condition
//     * @throws Exception
//     */
//    @RequestMapping(value = "/overAllSalesReports",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("总体销售情况报表")
//    public ActionResult overAllSalesReports(@RequestBody SearchCommonVO<DeliveryTrackingReportQueryVO> condition) throws Exception {
//        DeliveryTrackingReportQueryVO queryVO = condition.getFilters();
//        queryVO.setOrgId(getOrgId());
//
//        PageCommonVO pageCommonVO = reportService.getOverAllSalesReports(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    /**
//     * 代理商库存统计
//     * add by hh
//     * 2023年3月13日13点44分
//     * @param condition
//     */
//    @RequestMapping(value = "/dlsInventory",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("代理商库存统计")
//    public ActionResult<PageInfo<DlsInventoryVO>> dlsInventory(@RequestBody SearchCommonVO<DlsInventoryQueryVO> condition) throws Exception {
//        DlsInventoryQueryVO queryVO = condition.getFilters();
//        queryVO.setOrgId(getOrgId());
//
//        PageCommonVO<DlsInventoryVO> pageCommonVO = reportService.dlsInventory(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    /**
//     * 服务站库存统计
//     * add by hh
//     * 2023年3月16日13点20分
//     * @param condition
//     */
//    @RequestMapping(value = "/fwzInventory",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("服务站库存统计")
//    public ActionResult<PageInfo<FwzInventoryVO>> fwzInventory(@RequestBody SearchCommonVO<FwzInventoryQueryVO> condition) throws Exception {
//        FwzInventoryQueryVO queryVO = condition.getFilters();
//        String orgId = getOrgId();
//        queryVO.setOrgId(orgId);
//        ActionResult userAuth =  authClient.getUserDetail(getUserId());
//        UserCacheDTO userCacheDTO = (UserCacheDTO) userAuth.getValue();
//        String deptId = null;
//        if (userCacheDTO != null && !Strings.isNullOrEmpty(userCacheDTO.getDeptId())) {
//            //根据当前登录人的部门获取上级部门
//            deptId = reportService.getDeptId(userCacheDTO.getDeptId());
//        }
//        //获取驻外营销部id
//        String zwDeptId = reportService.getZwDeptId();
//        if (!Strings.isNullOrEmpty(deptId)&&!Strings.isNullOrEmpty(zwDeptId)){
//            if (deptId.equals(zwDeptId)){
//                //代表当前登录人是驻外营销部下的部门下员工，查询当前登录人的所拥有的服务中心code
//                List<String> codeList = reportService.getCodeList(userCacheDTO.getDeptId());
//                if (!CollectionUtils.isEmpty(codeList)){
//                    queryVO.setMarketingCenterCodes(codeList);
//                }
//            }
//        }
//        condition.setFilters(queryVO);
//        PageCommonVO<FwzInventoryVO> pageCommonVO = reportService.fwzInventory(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    /**
//     * 代理商进销存统计
//     * add by hh
//     * 2023年3月17日17点35分
//     * @param condition
//     */
//    @RequestMapping(value = "/dlsDrp",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("代理商进销存统计")
//    public ActionResult<PageInfo<DlsDrpVO>> dlsDrp(@RequestBody SearchCommonVO<DlsDrpQueryVO> condition) throws Exception {
//        DlsDrpQueryVO queryVO = condition.getFilters();
//        queryVO.setOrgId(getOrgId());
//
//        PageCommonVO<DlsDrpVO> pageCommonVO = reportService.dlsDrp(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
//    /**
//     * 服务站进销存统计
//     * add by hh
//     * 2023年3月18日10点41分
//     * @param condition
//     */
//    @RequestMapping(value = "/fwzDrp",method = RequestMethod.POST)
//    @FastMappingInfo(needLogin = true)
//    @ApiOperation("服务站进销存统计")
//    public ActionResult<PageInfo<FwzDrpVO>> fwzDrp(@RequestBody SearchCommonVO<FwzDrpQueryVO> condition) throws Exception {
//        FwzDrpQueryVO queryVO = condition.getFilters();
//        String orgId = getOrgId();
//        queryVO.setOrgId(orgId);
//        ActionResult userAuth =  authClient.getUserDetail(getUserId());
//        UserCacheDTO userCacheDTO = (UserCacheDTO) userAuth.getValue();
//        String deptId = null;
//        if (userCacheDTO != null && !Strings.isNullOrEmpty(userCacheDTO.getDeptId())) {
//            //根据当前登录人的部门获取上级部门
//            deptId = reportService.getDeptId(userCacheDTO.getDeptId());
//        }
//        //获取驻外营销部id
//        String zwDeptId = reportService.getZwDeptId();
//        if (!Strings.isNullOrEmpty(deptId)&&!Strings.isNullOrEmpty(zwDeptId)){
//            if (deptId.equals(zwDeptId)){
//                //代表当前登录人是驻外营销部下的部门下员工，查询当前登录人的所拥有的服务中心code
//                List<String> codeList = reportService.getCodeList(userCacheDTO.getDeptId());
//                if (!CollectionUtils.isEmpty(codeList)){
//                    queryVO.setMarketingCenterCodes(codeList);
//                }
//            }
//        }
//        condition.setFilters(queryVO);
//
//        PageCommonVO<FwzDrpVO> pageCommonVO = reportService.fwzDrp(condition);
//        return actionResult(pageCommonVO.getPageInfo());
//    }
//
}
